<%@ page import="pojo.Manager" %>
<%@ page import="pojo.Goods" %><%--
  Created by IntelliJ IDEA.
  User: konley
  Date: 2020/6/20
  Time: 16:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>小米商城 | 商品修改</title>
    <script src="${pageContext.request.contextPath }/js/jquery-3.4.1.js" type="text/javascript"
            charset="utf-8"></script>
    <script src="${pageContext.request.contextPath }/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/mistore.css"/>
    <script src="${pageContext.request.contextPath }/js/mistore.js" type="text/javascript" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath }/js/managerView.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<!--top-->
<div id="navi">
    <div style="background-color:#333333;" id="nav">
        <div class="container" style="height: 40px">
            <div class="row">
                <div class="col-sm-8" style="margin-top: 9px">
                    <ul class="top-nav" style="float: left">
                        <li><a href="index.jsp">小米商城</a></li>
                        <li>|</li>
                        <li><a href="#">MIUI</a></li>
                        <li>|</li>
                        <li><a href="#">IoT</a></li>
                        <li>|</li>
                        <li><a href="#">云服务</a></li>
                        <li>|</li>
                        <li><a href="#">小爱开放平台</a></li>
                        <li>|</li>
                        <li><a href="#">企业团购</a></li>
                        <li>|</li>
                        <li><a href="#">资质证照</a></li>
                        <li>|</li>
                        <li><a href="#">规则协议</a></li>
                        <li>|</li>
                        <li><a href="#">下载app</a></li>
                        <li>|</li>
                        <li><a href="#">Select Location</a></li>
                    </ul>
                </div>
                <% Manager manager = (Manager) session.getAttribute("manager");%>
                <div class="col-sm-4" style="margin-top: 9px">
                    <ul class="top-nav" style="float: left">
                        <li style="color: #ec971f">欢迎您，管理员，工号<%=manager.getId()%>
                        </li>
                        <li>|</li>
                        <li><a href="managerView.jsp">返回管理页</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<br><br>
<div class="container">
    <div class="row">
        <div class="col-sm-6 col-sm-offset-3">
            <div class="panel panel-success " style="margin-top: 50px;">
                <div class="panel-heading" style="background-color:#ff6700">
                    <h4 style="color: #ffffff"><strong>修改商品</strong></h4>
                </div>
                <%Goods goods = (Goods) request.getAttribute("goods");%>
                <div class="panel-body">
                    <form name="reg" action="GoodsServlet" method="post" class="form-horizontal" role="form" enctype="multipart/form-data">
                        <fieldset disabled>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">商品编号</label>
                                <div class="col-sm-8">
                                    <input class="form-control" type="text" value="SN-<%=goods.getId() %>"/>
                                </div>
                            </div>
                        </fieldset>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">名称</label>
                            <div class="col-sm-8">
                                <input name="name" class="form-control" type="text" placeholder="输入商品名称" value="<%=goods.getName()%>"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">类型</label>
                            <div class="col-sm-8">
                                <input name="type" class="form-control" type="text"  placeholder="输入商品类型" value="<%=goods.getType()%>"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">信息</label>
                            <div class="col-sm-8">
                                <textarea name="info" class="form-control" type="text"  placeholder="输入商品描述信息">
                                    <%=goods.getInfo()%>
                                </textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">库存</label>
                            <div class="col-sm-8">
                                <input name="stock" class="form-control" type="text"  placeholder="输入商品库存" value="<%=goods.getStock()%>"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">价格</label>
                            <div class="col-sm-8">
                                <input name="money" class="form-control" type="text"  placeholder="输入商品价格" value="<%=goods.getMoney()%>" />
                            </div>
                        </div>
                        <hr>
                        <div class="form-group text-center">
                            <input name="m" type="hidden" value="toUpdate"/>
                            <input name="id" type="hidden" value="<%=goods.getId()%>"/>
                            <input type="submit" value="确认修改" class="btn btn-success"/>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
<!--底栏-->
<div class="container">
    <div class="row" style="margin-top: 20px">
        <div class="col-sm-12 text-center" style="margin-top: 50px">
            <p>简体 | 繁体 | Englis | 常见问题 | 隐私政策</p>
            <p>小米公司版权所有 -京ICP备10046444 -京公网安备11010802020134号 -京ICP证110507号</p>
        </div>
    </div>
</div>
</body>
</html>
